function checkLotNumber()
{
	var p1 = -1;
	var p2 = -1;
	var lotName = '';
	var flag = true;
	for (var count =0; count < document.invDataEntry.lotNo.length; count++ )
	{
		p1 = document.invDataEntry.lotNo[count].value.indexOf('$')+1;
		p2 = document.invDataEntry.lotNo[count].value.lastIndexOf('$');
		lotName = document.invDataEntry.lotNo[count].value.substring(p1, p2).trim();
		if (lotName.toUpperCase() == document.invDataEntry.newlotNo.value.trim().toUpperCase())
		{
			flag = false;
			break;
		}
	}
	return flag;
}


function confirmUpdate()
{
	document.invDataEntry.confirm.value='confirm';
	saveInvetoryDataEntry();
}


function locationSelected(form)
{
    var pa=document.getElementById("message");
    var x = form.locationId;

    for(var i=0; i< x.length; i++)
    {
        if(x.options[i].selected)
        {
	        if(x.options[i].value == "0")
            {
	            pa.innerHTML = "<li>Select Location</li>";
                x.focus();
	            return false;
            }
        }
    }
    return true;
}


function productSelected(form){

    var pa=document.getElementById("message");
    var x = form.processStepId;

    for(var i=0; i< x.length; i++)
    {
        if(x.options[i].selected)
        {
	        if(x.options[i].value == "0")
            {
	            pa.innerHTML = "<li> Select Product Name";
                x.focus();
	            return false;
            }
        }
    }
    return true;
}


function lotNoSelected(form){

    var pa=document.getElementById("message");
    var x = form.lotNo;

    for(var i=0; i< x.length; i++)
    {
        if(x.options[i].selected)
        {
	        if(x.options[i].value == "0")
            {
	            pa.innerHTML = "<li> Select Lot Number";
                x.focus();
	            return false;
            }
        }
    }
    return true;
}


function isValidInteger(temp)
{
	errors = "";
	var pa=document.getElementById("message");

	if(!isInteger(temp.value)) {
		errors = "<li>Please enter a valid integer</li>";
		pa.innerHTML = errors;
		temp.focus();
		return false;
	}
	return true;
}
